package models;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author eagle_eye
 */
@Entity
@Table(name = "DECRETO", catalog = "sischool2", schema = "")
@NamedQueries({
    @NamedQuery(name = "Decreto.findAll", query = "SELECT d FROM Decreto d"),
    @NamedQuery(name = "Decreto.findByIdDecreto", query = "SELECT d FROM Decreto d WHERE d.idDecreto = :idDecreto"),
    @NamedQuery(name = "Decreto.findByLeyes", query = "SELECT d FROM Decreto d WHERE d.leyes = :leyes"),
    @NamedQuery(name = "Decreto.findByArticulo", query = "SELECT d FROM Decreto d WHERE d.articulo = :articulo"),
    @NamedQuery(name = "Decreto.findByCapitulo", query = "SELECT d FROM Decreto d WHERE d.capitulo = :capitulo"),
    @NamedQuery(name = "Decreto.findByNombreDec", query = "SELECT d FROM Decreto d WHERE d.nombreDec = :nombreDec"),
    @NamedQuery(name = "Decreto.findByConsideracion", query = "SELECT d FROM Decreto d WHERE d.consideracion = :consideracion"),
    @NamedQuery(name = "Decreto.findByDescripcion", query = "SELECT d FROM Decreto d WHERE d.descripcion = :descripcion")})
public class Decreto implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "idDecreto", nullable = false)
    private Integer idDecreto;
    @Basic(optional = false)
    @Column(name = "leyes", nullable = false, length = 45)
    private String leyes;
    @Basic(optional = false)
    @Column(name = "articulo", nullable = false, length = 100)
    private String articulo;
    @Basic(optional = false)
    @Column(name = "capitulo", nullable = false, length = 100)
    private String capitulo;
    @Basic(optional = false)
    @Column(name = "nombreDec", nullable = false, length = 100)
    private String nombreDec;
    @Basic(optional = false)
    @Column(name = "consideracion", nullable = false, length = 100)
    private String consideracion;
    @Column(name = "descripcion", length = 100)
    private String descripcion;
    @JoinColumn(name = "documentoId", referencedColumnName = "idDocumento", nullable = false)
    @ManyToOne(optional = false)
    private Documento documentoId;

    public Decreto() {
    }

    public Decreto(Integer idDecreto) {
        this.idDecreto = idDecreto;
    }

    public Decreto(Integer idDecreto, String leyes, String articulo, String capitulo, String nombreDec, String consideracion) {
        this.idDecreto = idDecreto;
        this.leyes = leyes;
        this.articulo = articulo;
        this.capitulo = capitulo;
        this.nombreDec = nombreDec;
        this.consideracion = consideracion;
    }

    public Integer getIdDecreto() {
        return idDecreto;
    }

    public void setIdDecreto(Integer idDecreto) {
        this.idDecreto = idDecreto;
    }

    public String getLeyes() {
        return leyes;
    }

    public void setLeyes(String leyes) {
        this.leyes = leyes;
    }

    public String getArticulo() {
        return articulo;
    }

    public void setArticulo(String articulo) {
        this.articulo = articulo;
    }

    public String getCapitulo() {
        return capitulo;
    }

    public void setCapitulo(String capitulo) {
        this.capitulo = capitulo;
    }

    public String getNombreDec() {
        return nombreDec;
    }

    public void setNombreDec(String nombreDec) {
        this.nombreDec = nombreDec;
    }

    public String getConsideracion() {
        return consideracion;
    }

    public void setConsideracion(String consideracion) {
        this.consideracion = consideracion;
    }

    public String getDescripcion() {
        return descripcion;
    }

    public void setDescripcion(String descripcion) {
        this.descripcion = descripcion;
    }

    public Documento getDocumentoId() {
        return documentoId;
    }

    public void setDocumentoId(Documento documentoId) {
        this.documentoId = documentoId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idDecreto != null ? idDecreto.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        if (!(object instanceof Decreto)) {
            return false;
        }
        Decreto other = (Decreto) object;
        if ((this.idDecreto == null && other.idDecreto != null) || (this.idDecreto != null && !this.idDecreto.equals(other.idDecreto))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "models.Decreto[idDecreto=" + idDecreto + "]";
    }

}
